<template>
  <Card title="风险点统计">
    <div class="alarm-num">
      <div class="left">
        <RoundProgress ref="RoundProgress" title="风险点总数"></RoundProgress>
      </div>
      <div class="right">
        <RectNum
          v-for="item in pieData"
          :label="item.control_level"
          :value="item.count"
          :border="false"
        ></RectNum>
      </div>
    </div>
    <div>
      <RectNum label="设备设施数量" value="1295" :border="false"></RectNum>
      <RectNum label="作业活动数量" value="4516" :border="false"></RectNum>
    </div>
  </Card>
</template>

<script>
import { defineComponent } from "vue";

import Card from "./Card.vue";
import RectNum from "./RectNum.vue";
import RoundProgress from "./RoundProgress.vue";

export default defineComponent({
  name: "RiskPoint",
  components: {
    Card,
    RectNum,
    RoundProgress,
  },
  data() {
    return {
      pieData: [],
    };
  },
  mounted() {},
  methods: {
    setData(data) {
      this.$refs.RoundProgress.render(data.dangerPointTotal);
      this.pieData = data.dangerPoint;
    },
  },
});
</script>

<style lang="scss" scoped>
.alarm-num {
  display: flex;
  align-items: center;

  .left {
    width: 50%;
  }

  .right {
    width: 50%;
  }
}

.chart {
  height: 200px;
}
</style>
